//封装所有接口api
import http from './index'


//菜单添加
export const menuAdd = (data: object) => http.post('/menuadd', data)
//菜单列表
export const menuList = (data: any) => http.get('/menulist', data)
//菜单获取
export const menuInfo = (data: object) => http.get('/menuinfo', data)
//菜单修改  
export const menuEdit = (data: object) => http.post('/menuedit', data)
//菜单删除  
export const menudDelete = (data: object) => http.post('/menudelete', data)

//角色管理
export const roleAdd = (data: object) => http.post('/roleadd', data)
//角色列表
export const roleList = () => http.get('/rolelist')
//角色获取
export const roleInfo = (data: object) => http.get('/roleinfo', data)
//角色修改
export const roleEdit = (data: object) => http.post('/roleedit', data)
//角色删除
export const roleDelete = (data: object) => http.post('/roledelete', data)

//管理员添加
export const userAdd = (data: object) => http.post('/useradd', data)
//管理员总数
export const userCount = () => http.get('/usercount')
//管理员列表
export const userList = (data: object) => http.get('/userlist', data)
//管理员获取
export const userInfo = (data: object) => http.get('/userinfo', data)
//管理员修改
export const userEdit = (data: object) => http.post('/useredit', data)
//管理员删除
export const userDelete = (data: object) => http.post('/userdelete', data)
//管理员登录
export const userLogin = (data: object) => http.post('/userlogin', data)

//添加
export const cateAdd = (data: object) => http.post('/cateadd', data, true)
//列表
export const cateList = (data: object) => http.get('/catelist', data)
//获取一条数据
export const cateInfo = (data: object) => http.get('/cateinfo', data)
//修改
export const cateEdit = (data: object) => http.post('/cateedit', data, true)
//删除
export const cateDelete = (data: object) => http.post('/catedelete', data)

//=====商品规格管理====
//商品规格添加
export const specsAdd = (data: object) => http.post('/specsadd', data)
//商品规格总数（用于计算分页）
export const specsCount = () => http.get('/specscount')
//商品规格列表（分页）
export const specsList = (data: object) => http.get('/specslist', data)
//商品规格获取（一条）
export const specsInfo = (data: object) => http.get('/specsinfo', data)
//商品规格修改
export const specsEdit = (data: object) => http.post('/specsedit', data)
//商品规格删除
export const specsDelete = (data: object) => http.post('/specsdelete', data)

//商品管理
export const goodsAdd = (data: object) => http.post('/goodsadd', data, true)
//商品总数（计算分页）
export const goodsCount = () => http.get('/goodscount')
//商品分类（分页）
export const goodsList = (data: object) => http.get('/goodslist', data)
//商品获取（一条）
export const goodsInfo = (data: object) => http.get('/goodsinfo', data)
//商品修改
export const goodsEdit = (data: object) => http.post('/goodsedit', data, true)
//商品删除
export const goodsDelete = (data: object) => http.post('/goodsdelete', data)

//会员管理
export const memberList = () => http.get('/memberlist')
//会员获取
export const memberInfo = (data: object) => http.get('/memberinfo', data)
//会员修改
export const memberEdit = (data: object) => http.post('/memberedit', data)

//轮播图添加
export const bannerAdd = (data: object) => http.post('/banneradd', data, true)
//轮播图列表
export const bannerList = () => http.get('/bannerlist')
//轮播图获取
export const bannerInfo = (data: object) => http.get('/bannerinfo', data)
//轮播图修改
export const bannerEdit = (data: object) => http.post('/banneredit', data, true)
//轮播图删除
export const bannerDelete = (data: object) => http.post('/bannerdelete', data)

//限时秒杀添加
export const seckAdd = (data: object) => http.post('/seckadd', data)
//限时秒杀列表
export const seckList = () => http.get('/secklist')
//限时秒杀获取
export const seckInfo = (data: object) => http.get('/seckinfo', data)
//限时秒杀修改
export const seckEdit = (data: object) => http.post('/seckedit', data)
//限时秒杀删除
export const seckDelete = (data: object) => http.post('/seckdelete', data)
